<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no"/>
    <title>商品详情</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../css/aui-flex.css"/>
    <link rel="stylesheet" type="text/css" href="../css/aui-slide.css"/>
    <link rel="stylesheet" type="text/css" href="../css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../css/common.css"/>
    <link rel="stylesheet" type="text/css" href="../css/aui-flex.css"/>
    <style>
        .aui-bar-nav {
            background-color: white;
            color: black;
        }

        body {
            font-size: 14px;
        }

        .mui-numbox.muiNum-min {
            width: 80px;
            height: 28px;
            padding: 0 25px;
        }

        .mui-numbox.muiNum-min button {
            width: 25px;
        }
    </style>
</head>
<body>

<div class=" " id="goodInfo-content">
    <!--<header>-->
        <!--<div class="slide">-->
            <!--<div id="aui-slide">-->
                <!--<div class="aui-slide-wrap">-->
                    <!--<div class="aui-slide-node ">-->
                        <!--<img src="../image/tese.jpg" alt="">-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="aui-slide-page-wrap"></div>-->
            <!--</div>-->
        <!--</div>-->
    <!--</header>-->
    <!--<div class="aui-content">-->
        <!--<ul class="aui-list-view">-->
            <!--<li class="aui-list-view-cell aui-img">-->
                <!--<div class="aui-img-body">-->
                    <!--<div class="aui-ellipsis-2 "><h5 class="font-black">这个是商品名称</h5></div>-->
                <!--</div>-->
            <!--</li>-->
            <!--<li class="aui-list-view-cell aui-flex-col0">-->
                <!--<div class="aui-flex-item-12 ">-->
                    <!--<p class=" font-size-12 aui-pull-left aui-margin-t-5 text-line-through">市场价：￥999</p>-->
                    <!--<div class="  aui-pull-right aui-margin-0 font-size-12  aui-hide">-->
                        <!--<em>可用</em>-->
                        <!--<em  class=" shangjing-color2 font-szie-18  ">20积分</em>-->
                        <!--<em>抵20元</em>-->
                    <!--</div>-->
                    <!--<div class="  aui-pull-right aui-margin-0">-->
                        <!--<h6 class="aui-pull-left">订单完成赠送</h6>-->
                        <!--<em class=" shangjing-color2 font-szie-18  ">20积分</em>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="aui-flex-item-12 aui-text-right line-height-27">-->
                    <!--<span class=" aui-pull-left"><h3 class=" aui-text-danger aui-margin-0 ">￥888元</h3></span>-->
                    <!--<h6 class="aui-pull-right aui-margin-0 line-height-27">-->
                        <!--<small>已有299人付款</small>-->
                    <!--</h6>-->

                <!--</div>-->
                <!--<div class="aui-flex-item-12 aui-border-b aui-padded-b-5">-->
                    <!--<p class="  aui-pull-left line-height-27">购买数量</p>-->

                    <!--<i class="aui-iconfont aui-icon-unfold aui-text-default aui-pull-right aui-margin-0  aui-padded-0 aui-padded-l-15"-->
                       <!--tapmode onclick="shouNumControl(this)"></i>-->
                <!--</div>-->
                <!--<div class="aui-flex-item-12 aui-padded-t-10 numControl dispalyNone-unImportant ">-->
                    <!--<div class="mui-numbox muiNum-min aui-pull-left" data-numbox-min='1' data-numbox-max='9'>-->
                        <!--<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>-->
                        <!--<input id="test" class="mui-input-numbox" type="number" value="1"/>-->
                        <!--<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>-->
                    <!--</div>-->
                    <!--&lt;!&ndash;<p class="aui-pull-right">总价格：288</p>&ndash;&gt;-->
                <!--</div>-->
            <!--</li>-->
        <!--</ul>-->
        <!--<ul class="aui-list-view">-->

            <!--<li class="aui-list-view-cell aui-img aui-text-center p" class="{{=it.supplier.supplier_id}}">-->
                <!--<div class="aui-btn border-color aui-padded-5-25"><i class="aui-iconfont aui-icon-shop font-black"></i>进入店铺-->
                <!--</div>-->
                <!--&lt;!&ndash;<img class="aui-img-object aui-pull-left" src="../image/shili.jpg">&ndash;&gt;-->

                <!--&lt;!&ndash;<div class="aui-ellipsis-1 " style="height: 60px;line-height: 60px;">尚景官方平台</div>&ndash;&gt;-->
            <!--</li>-->

        <!--</ul>-->
    <!--</div>-->
    <!--<div class="aui-content">-->
        <!--<div class="aui-text-center bg-white aui-padded-10 long-under-line"><span-->
                <!--class="bg-white z-index99-positon aui-padded-0-10">商品详情</span></div>-->
        <!--<div class="img100">-->

            <!--&lt;!&ndash;<img src="" alt="">&ndash;&gt;-->
            <!--<img src="../image/tese.jpg" alt="">-->
            <!--&lt;!&ndash;<img src="../image/tese.jpg" alt="">&ndash;&gt;-->
        <!--</div>-->
    <!--</div>-->
</div>

<script id="goodInfo-template" type="text/x-dot-template">
    <div class="good-info">
        <header>
            <div class="slide">
                <div id="aui-slide">
                    <div class="aui-slide-wrap">
                        <div class="aui-slide-node ">
                            <img src="{{=it.goods_img}}" alt="">
                        </div>
                    </div>
                    <div class="aui-slide-page-wrap"></div>
                </div>
            </div>
        </header>
        <div class="aui-content">
            <ul class="aui-list-view">
                <li class="aui-list-view-cell aui-img">
                    <div class="aui-img-body">
                        <div class="aui-ellipsis-2 "><h5 class="font-black">{{=it.goods_name}}</h5></div>
                    </div>
                </li>
                <li class="aui-list-view-cell aui-flex-col0">
                    <div class="aui-flex-item-12 ">
                        <p class=" font-size-12 aui-pull-left aui-margin-t-5 text-line-through">
                            市场价：￥{{=it.market_price}}</p>
                        {{? it.vmoney_user>0}}
                        <div class="  aui-pull-right aui-margin-0">
                            <h6 class="aui-pull-left aui-text-default">订单完成赠送</h6>
                            <em class=" shangjing-color2 font-szie-18  ">{{=it.vmoney_user}}积分</em>
                        </div>
                        {{??}}

                        <div class="  aui-pull-right aui-margin-0 ">
                            <em class=" aui-text-default font-size-12">可用</em>
                            <em class=" shangjing-color2 font-szie-18  ">{{=it.vmoney_unbackable}}积分</em>
                            <em>抵{{=it.vmoney_unbackable}}元</em>
                        </div>
                        {{}}}
                    </div>

                    <div class="aui-flex-item-12 aui-text-right line-height-27">
                        <span class=" aui-pull-left"><h3
                                class=" aui-text-danger aui-margin-0 ">￥{{=it.show_price}}元</h3></span>
                        <h6 class="aui-pull-right aui-margin-0 line-height-27">
                            <small>已有{{=it.sales_volume_base}}人付款</small>
                        </h6>

                    </div>
                    <div class="aui-flex-item-12 aui-border-b aui-padded-b-5 aui-hide">
                        <p class="  aui-pull-left line-height-27">购买数量</p>

                        <i class="aui-iconfont aui-icon-unfold aui-text-default aui-pull-right aui-margin-0  aui-padded-0 aui-padded-l-15"
                           tapmode onclick="shouNumControl(this)"></i>
                    </div>
                    <div class="aui-flex-item-12 aui-padded-t-10 numControl dispalyNone-unImportant ">
                        <div class="mui-numbox muiNum-min aui-pull-left" data-numbox-min='1' data-numbox-max='9'>
                            <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
                            <input id="test" class="mui-input-numbox" type="number" value="1"/>
                            <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
                        </div>
                        <!--<p class="aui-pull-right">总价格：288</p>-->
                    </div>
                </li>
            </ul>
            <ul class="aui-list-view">

                <li class="aui-list-view-cell aui-img aui-text-center p" class="">
                    <div class="aui-btn border-color aui-padded-5-25" tapmode
                         onclick="openShopInfo('{{=it.supplier.supplier_id}}')"><i
                            class="aui-iconfont aui-icon-shop font-black"></i>进入店铺
                    </div>
                    <!--<img class="aui-img-object aui-pull-left" src="../image/shili.jpg">-->

                    <!--<div class="aui-ellipsis-1 " style="height: 60px;line-height: 60px;">尚景官方平台</div>-->
                </li>

            </ul>
        </div>
    </div>
    <div class="aui-content good-detail dispalyNone-unImportant" style="display: none;">
        <div class="aui-text-center bg-white aui-padded-10 long-under-line"><span
                class="bg-white z-index99-positon aui-padded-0-10">商品详情</span></div>
        <div class="img100">

            <!--<img src="" alt="">-->
            <img src="{{=it.goods_img}}" alt="">
            <!--<img src="../image/tese.jpg" alt="">-->
        </div>
    </div>


</script>
</body>

<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/myInfo.js"></script>
<script type="text/javascript" src="../script/doT.min.js"></script>
<script type="text/javascript" src="../script/mui.min.js"></script>
<script type="text/javascript" src="../script/jquery-1.11.3.js"></script>
<script type="text/javascript" src="../script/aui-slide.js"></script>
<script type="text/javascript">
    var goodId = "",supplierId="";
    apiready = function () {
        api.parseTapmode();
        goodId = api.pageParam.goodId;
//        var header = $api.dom('header');
//        $api.fixIos7Bar(header);

        getGoodInfo();
        // api.addEventListener({
        //     name: 'scrolltobottom'
        // }, function (ret, err) {
        //     changeChoose("good-detail");
        //     api.sendEvent({
        //         name: "changeChoose",
        //         extra: {
        //             type: "good-detail"
        //         }
        //     })
        // })

    }
    $(function () {
        slide()
    })
    function slide() {
        var slide3 = new auiSlide({
            container: document.getElementById("aui-slide"),
            // "width":300,
            "height": 240,
            "speed": 500,
            "autoPlay": 3000, //自动播放
            "loop": true,
            "pageShow": true,
            "pageStyle": 'dot',
            'dotPosition': 'center'
        })
    }
    function goToBuyFrm() {

        goToBuy()
    }

    function getGoodInfo() {
        showLoading()
        var url = "goods/info";
        var data = {};
        data["goods_id"] = goodId;
        getStorageAll();
        ajaxRequest(url, 'get', data, function (ret, err) {
            hideLoading();
            api.sendEvent({
                name:"loadGoodFinish",
                extra:{
                    goodType:ret.data.order_type
                }
            })
            supplierId=ret.data.supplier.supplier_id;
            var content = $api.byId('goodInfo-content');
            var tpl = $api.byId('goodInfo-template').text;
            var tempFn = doT.template(tpl);
//            if (page > 1) {
//                if (!$.trim(ret.data)) {
//                    return;
//                }
//                $api.append(content, tempFn(ret.data));
//            } else {
//                showNoTip(ret.data);
//
//            }
//            $api.html(content, tempFn(ret.data));

            $(".aui-slide-wrap").html('<div class="aui-slide-node "><img src="' + ret.data.goods_img + '{{=it.goods_img}}" /></div>')


            $api.html(content, '');
            $api.html(content, tempFn(ret.data));
            slide();
        });
    }
    //显示隐藏数字输入框
    function shouNumControl(obj) {
        if ($(obj).hasClass("aui-icon-unfold")) {
            $(obj).removeClass("aui-icon-unfold");
            $(obj).addClass("aui-icon-fold");
            $(".numControl").show();
        } else {
            $(obj).addClass("aui-icon-unfold");
            $(obj).removeClass("aui-icon-fold");
            $(".numControl").hide();

        }
    }
    function changeChoose(type) {
        if (type == "good-info") {
            $(".good-info").show();
            $(".good-detail").hide();
        } else {
            $(".good-info").hide();
            $(".good-detail").show();
        }
    }
    function goToSupplier() {
        openShopInfo(supplierId)
    }
</script>
</html>
